package com.zrlh.file_trans_monitor.entity;

import com.alibaba.fastjson.JSONObject;
import lombok.Data;

@Data
public class TaskConfEntity implements Comparable<TaskConfEntity>{
    private String taskName;
    private Integer expectTime;
    private Integer fileNameType;

    private String localPath;
    private String fileName;
    private String fileSuffix;
    private String absolutePath;
    private boolean status=false;

    @Override
    public String toString() {
        return "TaskConfEntity{" +
                "taskName='" + taskName + '\'' +
                ", expectTime=" + expectTime +
                ", fileNameType=" + fileNameType +
                ", localPath='" + localPath + '\'' +
                ", fileName='" + fileName + '\'' +
                ", fileSuffix='" + fileSuffix + '\'' +
                '}';
    }
    public String toJson(){
        JSONObject object = new JSONObject();
        object.put("taskName",taskName);
        object.put("expectTime",expectTime);
        object.put("fileNameType",fileNameType);
        object.put("localPath",localPath);
        object.put("fileName",fileName);
        object.put("fileSuffix",fileSuffix);
        return object.toString();
    }

    @Override
    public int compareTo(TaskConfEntity o) {
        return this.expectTime-o.expectTime;
    }

    public String toStringStatus() {
        return "TaskConfEntity{" +
                "taskName='" + taskName + '\'' +
                ", status=" + status +
                '}';
    }
}
